pull: Properly propagate errors
authorColin Walters <walters@verbum.org>
Wed, 20 Jun 2012 19:42:41 +0000 (15:42 -0400)
committerColin Walters <walters@verbum.org>
Wed, 20 Jun 2012 19:42:41 +0000 (15:42 -0400)
src/ostree/ostree-pull.c

index a7be92dd262d77e4332d5cffa722d3eb64c1ab5d..156facf08369d0fbcf0da959a7c1da036ce7b0f6 100644 (file)
@@ -185,11 +185,15 @@ check_outstanding_requests_handle_error (OtPullData          *pull_data,
     g_main_loop_quit (pull_data->loop);
   if (error)
     {
-      pull_data->caught_error = TRUE;
-      if (pull_data->async_error)
-        g_error_free (error);
+      if (!pull_data->caught_error)
+        {
+          pull_data->caught_error = TRUE;
+          g_propagate_error (pull_data->async_error, error);
+        }
       else
-        g_propagate_error (pull_data->async_error, error);
+        {
+          g_error_free (error);
+        }
     }
 }